<?php
	header("Content-type:text/html;charset=utf-8");    //设置编码
	
	$servername = "localhost";
	$username = "hotel";
	$password = "vw8jj2";
	// 创建连接
	$conn = new mysqli($servername, $username, $password,"",3308);
	 
	// 检测连接
	if ($conn->connect_error) {
	    die("连接失败: " . $conn->connect_error);
	} 
	echo "连接成功喽";

	// 创建数据库
	$sql = "CREATE DATABASE consult";
	if (mysqli_query($conn, $sql)) {
	    echo "数据库创建成功";
	} else {
	    echo "数据库创建失败 " . mysqli_error($conn);
	}

	mysqli_close($conn);
?>
